#include<bits/stdc++.h>
using namespace std;

int main()
{
    string word;
    string pattern = "[a-zA-Z]*[^c]ei[a-zA-Z]*";
    regex reg(pattern);
    while (true)
    {
        getline(cin,word);
        if(word == "q")
        break;
        sregex_iterator it(word.begin(),word.end(),reg);
        auto end_it = sregex_iterator();
        for(; it!=end_it ; ++it)
        {
            cout<<it->str()<<endl;
        }
    }
    
}